#ifndef UDPSEVER_H
#define UDPSEVER_H

#include <QObject>
#include <QtNetwork>
#include "main.h"
#include "network/tlpacket.h"
#include "utils/Config.h"

class UDPSever : public QThread
{
    Q_OBJECT
public:
    UDPSever(quint16 port, QObject *parent = 0);
    void run();

//public slots:
    void processPendingDatagrams();

private:
    QUdpSocket* _UDPServer;
    quint16 _port;
    mutable QMutex mutex;
    QString gettick(quint32 val);
    quint32 tiempo;
    QMap <quint32,quint32> _clients;

};

#endif // UDPSEVER_H
